﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="InputStudentInfo.aspx.cs" Inherits="ExamAnalysis.Input.InputStudentInfo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
     <table border="0" width="800">
        <tr>
            <td>
                <img src="../Images/main/button-student.jpg" />
            </td>
            <td>
                <ext:Panel runat="server" Height="200" Title="录入学生信息" Width="500">
                    <TopBar>
                        <ext:StatusBar StatusAlign="Left" runat="server">
                            <Items>
                                <ext:Label Text="选择班级：" runat="server"></ext:Label>
                                <ext:DropDownField ID="ddClass" runat="server" Width="350" Editable="false" >
                                    <Component>
                                        <ext:GridPanel ID="gridPanel1" runat="server">
                                            <Store>
                                                <ext:Store ID="Store1" runat="server" DataSourceID="LinqDataSource1">
                                                    <Model>
                                                        <ext:Model ID="Model1" runat="server">
                                                            <Fields>
                                                                <ext:ModelField Name="ClassID">
                                                                </ext:ModelField>
                                                                <ext:ModelField Name="ClassName">
                                                                </ext:ModelField>
                                                                <ext:ModelField Name="ClassType">
                                                                </ext:ModelField>
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                            <ColumnModel ID="ColumnModel1" runat="server">
                                                <Columns>
                                                    <ext:Column ID="Column1" runat="server" DataIndex="ClassID" Text="班级ID">
                                                    </ext:Column>
                                                    <ext:Column ID="Column2" runat="server" DataIndex="ClassName" Text="班级名">
                                                    </ext:Column>
                                                    <ext:Column ID="Column3" runat="server" DataIndex="ClassType" Text="班级种类">
                                                    </ext:Column>
                                                    <ext:ImageCommandColumn ID="ImageCommandColumn1" runat="server" Align="Center">
                                                        <Commands>
                                                            <ext:ImageCommand Icon="ArrowRight" CommandName="Pick">
                                                                <ToolTip Title="选择" Text="点击选择班级" />
                                                            </ext:ImageCommand>
                                                        </Commands>
                                                        <Listeners>
                                                            <Command Handler="this.grid.dropDownField.setValue(record.data.ClassName);#{hiddenClassId}.setValue(record.data.ClassID);" />
                                                        </Listeners>
                                                    </ext:ImageCommandColumn>
                                                </Columns>
                                            </ColumnModel>
                                        </ext:GridPanel>
                                    </Component>
                                </ext:DropDownField>
                                <ext:ToolbarFill runat="server" />
                            </Items>
                        </ext:StatusBar>
                    </TopBar>
                    <Content>
                        <div style="padding:10px;">
                            <h3>上传说明：</h3>
                            <p>1.上传前请先选择指定的班级</p>
                            <p>2.上传文件类型限制：Excel文档（.xls,.xlsx)</p>
                            <p>3.上传文件大小限制：5MB，若要上传大文件，请联系系统管理员</p>
                            <p>4.Excel文档格式要求：请下载并参考<a href="ExcelTemplate/学生信息录入模版.xlsx">学生信息录入模版.xlsx</a></p>
                        </div>
                    </Content>
                    <BottomBar>
                        <ext:StatusBar runat="server">
                            <Items>
                                <ext:Label Text="上传文档：" runat="server"></ext:Label>
                                <ext:Hidden ID="hiddenClassId"  runat="server"></ext:Hidden>
                                <ext:FileUploadField ID="FileField" runat="server" Width="300" Icon="Attach"   ButtonText="浏览"/>
                                <ext:Button ID="btnUpload" runat="server" Text="确定上传" OnDirectClick="btnUpload_DirectClick">
                                </ext:Button>
                                <ext:ToolbarFill runat="server" />
                            </Items>
                        </ext:StatusBar>
                    </BottomBar>
                </ext:Panel>
            </td>
        </tr>
    </table>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="ExamAnalysis.Model.ExamAnalysisDataContext"
        EntityTypeName="" Select="new (ClassID, ClassName, ClassType)" 
        TableName="ClassInfo">
    </asp:LinqDataSource>
</asp:Content>
